<figure class="image">
  <img style="aspect-ratio:1050/259;" src="Table View_image.png" width="1050"
  height="259">
</figure>
<p>The table view displays information in a grid, where the rows are individual
  notes and the columns are&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>.
  In addition, values are editable.</p>
<h2>How it works</h2>
<p>The tabular structure is represented as such:</p>
<ul>
  <li>Each child note is a row in the table.</li>
  <li>If child rows also have children, they will be displayed under an expander
    (nested notes).</li>
  <li>Each column is a <a href="#root/_help_OFXdgB2nNk1F">promoted attribute</a> that
    is defined on the Collection note.
    <ul>
      <li>Actually, both promoted and unpromoted attributes are supported, but it's
        a requirement to use a label/relation definition.</li>
      <li>The promoted attributes are usually defined as inheritable in order to
        show up in the child notes, but it's not a requirement.</li>
    </ul>
  </li>
  <li>If there are multiple attribute definitions with the same <code>name</code>,
    only one will be displayed.</li>
</ul>
<p>There are also a few predefined columns:</p>
<ul>
  <li>The current item number, identified by the <code>#</code> symbol.
    <ul>
      <li>This simply counts the note and is affected by sorting.</li>
    </ul>
  </li>
  <li><a class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>,
    representing the unique ID used internally by Trilium</li>
  <li>The title of the note.</li>
</ul>
<h2>Interaction</h2>
<h3>Creating a new table</h3>
<p>Right click the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and
  select <em>Insert child note</em> and look for the <em>Table item</em>.</p>
<h3>Adding columns</h3>
<p>Each column is a <a href="#root/_help_OFXdgB2nNk1F">promoted or unpromoted attribute</a> that
  is defined on the Collection note.</p>
<p>To create a new column, either:</p>
<ul>
  <li>Press <em>Add new column</em> at the bottom of the table.</li>
  <li>Right click on an existing column and select Add column to the left/right.</li>
  <li>Right click on the empty space of the column header and select <em>Label</em> or <em>Relation</em> in
    the <em>New column</em> section.</li>
</ul>
<h3>Adding new rows</h3>
<p>Each row is actually a note that is a child of the Collection note.</p>
<p>To create a new note, either:</p>
<ul>
  <li>Press <em>Add new row</em> at the bottom of the table.</li>
  <li>Right click on an existing row and select <em>Insert row above, Insert child note</em> or <em>Insert row below</em>.</li>
</ul>
<p>By default it will try to edit the title of the newly created note.</p>
<p>Alternatively, the note can be created from the&nbsp;<a class="reference-link"
  href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;or <a href="#root/_help_CdNpE2pqjmI6">scripting</a>.</p>
<h3>Context menu</h3>
<p>There are multiple menus:</p>
<ul>
  <li>Right clicking on a column, allows:
    <ul>
      <li>Sorting by the selected column and resetting the sort.</li>
      <li>Hiding the selected column or adjusting the visibility of every column.</li>
      <li>Adding new columns to the left or the right of the column.</li>
      <li>Editing the current column.</li>
      <li>Deleting the current column.</li>
    </ul>
  </li>
  <li>Right clicking on the space to the right of the columns, allows:
    <ul>
      <li>Adjusting the visibility of every column.</li>
      <li>Adding new columns.</li>
    </ul>
  </li>
  <li>Right clicking on a row, allows:
    <ul>
      <li>Opening the corresponding note of the row in a new tab, split, window
        or quick editing it.</li>
      <li>Inserting a new note above or below the selected row. These options are
        only enabled if the table is not sorted.</li>
      <li>Inserting a new child note for the selected row.</li>
      <li>Deleting the row.</li>
    </ul>
  </li>
</ul>
<h3>Editing data</h3>
<p>Simply click on a cell within a row to change its value. The change will
  not only reflect in the table, but also as an attribute of the corresponding
  note.</p>
<ul>
  <li>The editing will respect the type of the promoted attribute, by presenting
    a normal text box, a number selector or a date selector for example.</li>
  <li>It also possible to change the title of a note.</li>
  <li>Editing relations is also possible
    <ul>
      <li>Simply click on a relation and it will become editable. Enter the text
        to look for a note and click on it.</li>
      <li>To remove a relation, remove the title of the note from the text box and
        click outside the cell.</li>
    </ul>
  </li>
</ul>
<h3>Editing columns</h3>
<p>It is possible to edit a column by right clicking it and selecting <em>Edit column.</em> This
  will basically change the label/relation definition at the collection level.</p>
<p>If the <em>Name</em> field of a column is changed, this will trigger a batch
  operation in which the corresponding label/relation will be renamed in
  all the children.</p>
<h2>Working with the data</h2>
<h3>Sorting by column</h3>
<p>By default, the order of the notes matches the order in the&nbsp;<a class="reference-link"
  href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>. However, it is possible
  to sort the data by the values of a column:</p>
<ul>
  <li>To do so, simply click on a column.</li>
  <li>To switch between ascending or descending sort, simply click again on
    the same column. The arrow next to the column will indicate the direction
    of the sort.</li>
  <li>To disable sorting and fall back to the original order, right click any
    column on the header and select <em>Clear sorting.</em>
  </li>
</ul>
<h3>Reordering and hiding columns</h3>
<ul>
  <li>Columns can be reordered by dragging the header of the columns.</li>
  <li>Columns can be hidden or shown by right clicking on a column and clicking
    the item corresponding to the column.</li>
</ul>
<h3>Reordering rows</h3>
<p>Notes can be dragged around to change their order. To do so, move the
  mouse over the three vertical dots near the number row and drag the mouse
  to the desired position.</p>
<p>This will also change the order of the note in the&nbsp;<a class="reference-link"
  href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</p>
<p>Reordering does have some limitations:</p>
<ul>
  <li>If the parent note has <code>#sorted</code>, reordering will be disabled.</li>
  <li>If using nested tables, then reordering will also be disabled.</li>
  <li>Currently, it's possible to reorder notes even if column sorting is used,
    but the result might be inconsistent.</li>
</ul>
<h3>Nested trees</h3>
<p>If the child notes of the collection also have their own child notes,
  then they will be displayed in a hierarchy.</p>
<p>Next to the title of each element there will be a button to expand or
  collapse. By default, all items are expanded.</p>
<p>Since nesting is not always desirable, it is possible to limit the nesting
  to a certain number of levels or even disable it completely. To do so,
  either:</p>
<ul>
  <li>Go to <em>Collection Properties</em> in the&nbsp;<a class="reference-link"
    href="#root/_help_BlN9DFI679QC">Ribbon</a>&nbsp;and look for the <em>Max nesting depth</em> section.
    <ul>
      <li>To disable nesting, type 0 and press Enter.</li>
      <li>To limit to a certain depth, type in the desired number (e.g. 2 to only
        display children and sub-children).</li>
      <li>To re-enable unlimited nesting, remove the number and press Enter.</li>
    </ul>
  </li>
  <li>Manually set <code>maxNestingDepth</code> to the desired value.</li>
</ul>
<p>Limitations:</p>
<ul>
  <li>While in this mode, it's not possible to reorder notes.</li>
</ul>
<h2>Limitations</h2>
<ul>
  <li>Multi-value labels and relations are not supported. If a&nbsp;<a class="reference-link"
    href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;is defined
    with a <em>Multi value</em> specificity, they will be ignored.</li>
  <li>There is no support to filter the rows by a certain criteria. Consider
    using the table view in search for that use case.</li>
</ul>
<h2>Use in search</h2>
<p>The table view can be used in a&nbsp;<a class="reference-link" href="#root/_help_m523cpzocqaD">Saved Search</a>&nbsp;by
  adding the <code>#viewType=table</code> attribute.</p>
<p>Unlike when used in a Collection, saved searches are not limited to the
  sub-hierarchy of a note and allows for advanced queries thanks to the power
  of the&nbsp;<a class="reference-link" href="#root/_help_eIg8jdvaoNNd">Search</a>.</p>
<p>However, there are also some limitations:</p>
<ul>
  <li>It's not possible to reorder notes.</li>
  <li>It's not possible to add a new row.</li>
</ul>
<p>Columns are supported, by being defined as&nbsp;<a class="reference-link"
  href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;to the&nbsp;
  <a
  class="reference-link" href="#root/_help_m523cpzocqaD">Saved Search</a>&nbsp;note.</p>
<p>Editing is also supported.</p>